home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 1999 May / SGI IRIX 6.5 Applications 1999 May.iso / dist / annotator.idb / usr / lib / Annotator / www_script.z / www_script
Text File  |  1996-12-06  |  1KB  |  58 lines

  1. #!/bin/csh -f
  2.  
  3. #
  4. # first argument is a URL, second argument is process ID 
  5. # (process ID of -1 means that a new process is needed)
  6.  
  7. set noglob = 1
  8.  
  9. #echo "in WWW script"
  10. #echo "  URL is $1"
  11. #echo "  geometry is $2"
  12. #echo "  pid is $3"
  13. #echo "WEBBROWSER" $WEBBROWSER
  14.  
  15. if ($?WEBBROWSER) then
  16.     if ($WEBBROWSER == xmosaic) then
  17.     which xmosaic >& /dev/null
  18.     if ($status == 0) then
  19.         if ($3 != -1) then
  20.         # there's already a xmosaic process running, so do
  21.            # the signal protocol
  22.         cat > /tmp/Mosaic.$3 << EOF
  23. goto
  24. $1
  25. EOF
  26.         kill -USR1 $3
  27.         else
  28.         # there's no xmosaic running, so go ahead and start one
  29.         exec xmosaic $1
  30.         endif        
  31.         exit
  32.     endif
  33.     endif    
  34. endif
  35.  
  36. which netscape >& /dev/null
  37. if ($status == 0) then
  38.     # first, try the remote control thing
  39.  
  40.     netscape -remote openURL\($1\) >& /dev/null 
  41.  
  42.     # if it didn't work, then you're either running an old
  43.     # version of netscape that doesn't support the -remote
  44.     # command, or there's no netscape process running
  45.     if ($status != 0) then
  46.         if ($2 == NONE) then
  47.         exec netscape $1 
  48.     else
  49.         exec netscape $1 -geometry $2
  50.     endif
  51.     endif
  52. else
  53.    # can't find netscape 
  54.    exit -1
  55. endif
  56.  
  57.